import React from 'react'
import { withRouter } from 'react-router-dom'
import Tit from '../../components/Tit'
import './InviteCode.less'
class InviteCode extends React.Component {
    state = {
        User: null
    }
    componentDidMount() {
        this.$getData('/api/user/getUserMsg', params => {
            console.log(params)
            switch (params.code) {
                case 100:
                    this.setState({
                        User: params.data
                    })
                    break;
                default:
                    this.Toast.info(params.msg);
                    break;
            }
        })
    }
    render() {
        return (
            <div>
                {this.state.User ?
                    <div className='InviteCode'>
                        <Tit zz={false} tit={'推广码'}></Tit>
                        <p className='InviteCode-p1'>邀请好得现金奖励，多邀多得!</p>
                        <p className='InviteCode-p2'>下级使用推广码成功购物并发货即可立即获得</p>
                        <div className='InviteCode-d1 center'>
                            <div className='InviteCode-d2'>
                                <img src={require("../../static/img/488966EE53C196F1BDF1AE181A4561F8.png")} alt="" />
                                <p>我的推广码</p>
                            </div>
                            <div className='InviteCode-d3 center'>
                                <img className='InviteCode-d3-i1' src={require("../../static/img/qian1.png")} alt="" />
                                <div className='InviteCode-d4 center'>
                                    <img src={this.state.User.atavar} alt="" />
                                    <p>{this.state.User.nickName}</p>
                                </div>
                                <img className='InviteCode-d3-i2' src={require('../../static/img/qian2.png')} alt="" />
                            </div>
                        </div>
                    </div> : <div></div>}
            </div>
        )
    }
}

export default withRouter(InviteCode)